<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$wxControl = new BUIWXControl();
$model = new BTBManageTourBoxFormModel();
$spId = Blyn::app()->getActiveSpace()->getId();
$opId = Blyn::app()->getActiveOperation()->getId();
$openId = '123';
?>
<?php if (isset($addResult)) { ?>
    <div class="well-small">
        <div class="row text-info large"> Add translation successfully!</div>
        <div class="row"> Native Language: <?php echo $addResult['nativeSentence']; ?></div>
        <div class="row"> Foreign Language: <?php echo $addResult['foreignSentence']; ?></div>
    </div>
<?php } ?>
<div class="form">
    <?php echo CHtml::beginForm(); ?>

    <?php echo CHtml::errorSummary($model); ?>

    <div class="row">
        <?php echo CHtml::activeLabel($model, 'nativeLanguage'); ?>
        <?php echo CHtml::activeDropDownList($model, 'nativeLanguage', $languageList); ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabel($model, 'nativeCategory'); ?>
        <?php echo CHtml::activeDropDownList($model, 'nativeCategory', $nativeCategoryList); ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabel($model, 'nativeSentence'); ?>
        <?php echo CHtml::activeTextField($model, 'nativeSentence') ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabel($model, 'foreignLanguage'); ?>
        <?php echo CHtml::activeDropDownList($model, 'foreignLanguage', $languageList); ?>
    </div>    

    <div class="row">
        <?php echo CHtml::activeLabel($model, 'foreignSentence'); ?>
        <?php echo CHtml::activeTextField($model, 'foreignSentence') ?>
    </div>    

    <div class="row submit">
        <?php echo $control->getAjaxLink('Submit', array('htmlOptions' => array('class' => 'btn'))); ?>
        <?php
        echo $control->getLink('Test Wechat Page', array(
            'dv' => 'wx',
            'sp' => $spId,
            'op' => $opId,
            'openid' => '123',
            'htmlOptions' => array('class' => 'btn', 'target' => '_blank')));
        ?>
    </div>    

    <?php echo CHtml::endForm(); ?>
</div><!-- form -->
